﻿<!--#include file="../lib/base.asp"-->
<!--#include file="../theme.asp"-->
<%
	sdcms.checkuserlogin
	sub deldb()
		dim id:id=sdcms.getint(sdcms.fget("id",0),0)
		if id<>0 then
			dim userdata:userdata=sdcms.userinfo
			dim userid:userid=userdata(0)
			dim data:data=sdcms.db.dbload(1,"(select tablename from view_category where cateid=sd_content.classid) as tablename","sd_content","userid="&userid&" and id="&id&"","")
			if ubound(data)>=0 then
				sdcms.db.dbdel data(0,0),"cid="&id&""
				sdcms.db.dbdel "sd_content","userid="&userid&" and id="&id&""
			end if
		end if
		sdcms.echo "1删除成功"
	end sub
	
	dim act:act=lcase(sdcms.fget("act",0))
	select case act
		case "add"
			dim sql_where
			if datatype then
				sql_where=" and instr(1,lcase(sonid),',',0)=0"
			else
				sql_where=" and sonid not like '%,%'"
			end if
			sdcms.show theme_user_publish_add,""
		case "del":deldb
		case else
			dim v:v=trim(sdcms.fget("v",0))
			dim sqlwhere
			select case v
				case "1":sqlwhere=" and islock=1"
				case "2":sqlwhere=" and islock=-1"
				case "3":sqlwhere=" and islock=-2"
				case else:v=0:sqlwhere=""
			end select
			sdcms.show theme_user_publish,""
	end select
	sdcms.db.dbclose
%>